package com.usian.user.controller;

import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.user.dtos.AuthDto;
import com.usian.user.ApUserRealNameControllerApi;
import com.usian.user.service.ApUserRealNameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/auth")
public class ApUserRealNameController implements ApUserRealNameControllerApi {


    @Autowired
    private ApUserRealNameService apUserRealNameService;

    /**
     * 用户认证审核列表查询
     *
     * @param dto
     * @return
     */
    @Override
    @PostMapping("list")
    public ResponseResult findListByStatus(@RequestBody AuthDto dto) {
        return apUserRealNameService.findListByStatus(dto);
    }

    /**
     * 审核成功
     *
     * @param dto
     * @return
     */
    @Override
    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody AuthDto dto) {
        return apUserRealNameService.updateStatusById(dto);
    }

    /**
     * 审核失败
     *
     * @param dto
     * @return
     */
    @PostMapping("/authFail")
    @Override
    public ResponseResult authFail(@RequestBody AuthDto dto) {
        return apUserRealNameService.updateStatusById(dto);
    }
}
